defined in actionsupport. Four string attributes are defined in actionsupport, namely success, input, error, and login.
In this way, our action has been completed, but there is still a problem. How can we let struts2 know our custom action, and can I submit the action to the action on the HTML/JSP page? The answer is to configure the Struts. xml file.
4. Configure struts. xml
In this struts. xml configuration file, it can be found that and the previous struts-config.xml has been compl
Automatic prompt for strust. xml code in MyEclipse, and prompt for myeclipse code
1. Open the MyEclipse Window and select the "Preferences" option under the "Window" menu,
2. Search for "xml" in the "Preferences" interface, select the "XML Catalog" option, and then select the "Add..." button on the right.
3. In the displayed dialog box, enter struts in "location. the location of the dtd file corresponding to the xml file. It is recommended that you
ActionForm is essentially a javabean, which is used to process form data. According to some characteristics of form data, ActinForm also has some special functions, such as validate () used to process form data verification and reset () for data
The action class is a bridge between user requests and business logic, and each action acts as a business agent for the customer. When you requestprocessor a class preprocessing request, after you create an instance of the action, you call its own
The struts framework allows only one Actionservlet class to exist in the application, but there can be multiple, customized requestprocessor classes, each of which can have a separate requestprocessor class.
Actionservlet is primarily responsible
As we all know, the Struts controller component is responsible for accepting user requests, for more models, and for returning the appropriate view components to the user.The controller separates the model layer from the view layer so that different
Recently I think idea is a good Java development tool, so I tried to switch from myeclipse to idea. After I used it, I found that it was really good. The Code prompts and interfaces were quite good, so I used idea to develop a Java Web project. By the way, I recorded the process of setting up the strust project in idea.
Step 1: Open Idea and select create new project.
Step 2: configure the Tomcat server. Click new> Tomcat server on the right of appl
Strust is equivalent to an empty container, and the built-in interceptor completes most of the operations on the framework. The struts2 interceptor is pluggable. To use an interceptor, you only need to apply it to the configuration file. If you do not need it, cancel it in the configuration file. Configure the interceptor Syntax: interceptor-stackname
Strust is equivalent to an empty container, and the buil
website development experience, experience in web game or mobile game development;
2. proficient in JSP, J2EE, JavaBean, spring, ibatis, strust, and other technologies and use of eclipse development tools;
3. proficient in Web application development on the Windows platform, understanding Asp.net (C #) and other related development languages;
4. proficient in HTML, JavaScript, Ajax, and XML, and proficient in client programming using JavaScript;
5. F
Extended File Upload
Set the File Upload format, size, and prompt information
1. Set the File Upload format and size to be configured in struts. xml. Use the struts interceptor fileupload, but be sure to add the default interceptor; otherwise, fileupload cannot be found.
2. Set the prompt information when uploading files, is according to the struts core package under the strust-messages.properties file, you can customize a global configuration fi
A small Strust2 example
Then I found that css, js, and images could not be used. I found that I could not access these resources (404 error) under debugger. That is a good example. I should look at the pictures in the book at least.
It is found that the filter problem in web. xml is as follows:
Web. xml
The red part of the code filters out All accesses. Isn't access to css, js, and other resources filtered out? But the example in that book is written in this way. Is Mao !!. Mom.
The
core controller of Strust, which is responsible for intercepting the user's request. Action, which is typically provided by the user, is responsible for receiving the request from Actionservlet and invoking the business logic method of the model to process the request and returning the processing results to the JSP page display. The 2.Model part consists of Actionform and JavaBean, wherein Actionform is used to encapsulate the user's request paramete
. So to sum it up, the current Lomboz does not support the latest version of Tomcat. It is more convenient to recommend a slightly earlier version.
Also welcome you and me on the Java issue discussion and contact: yi_can@163.comAuthor Blog: http://blog.csdn.net/emestudio/ related articles
The runlevels of Redhat9 and Gentoo Linux
The solution of the culture problem of Java Web application in Strust framework
Using M
layer, and view layer. In the model layer, the Hibernate framework allows JavaBean to generate tables and associations in the database, manipulate the database through the operation of the JavaBean, view layer, display the page to the user with the JSP template, and provide the interaction with the user; control layer, Use the Strust framework to connect data and view layers for receiving, processing, sending data, and controlling processes. The spri
Before learning Strust2, we should understand the purpose of using STRUTS2? What benefits can it bring to us?Design goalsThe first goal of Strust design is to apply the MVC pattern to Web programming.Technical advantagesSTRUTS2 has two technical advantages.One is that all STRUTS2 applications are based on the Client/server HTTP exchange protocol, the Java Servlet API reveals that Java servlet is just a small subset of the Java API, This allows us to p
() to return a value not greater than 127. Conclusion
It makes some programs wrong, but does not give developers any way to tell their code whether to execute these actions. If it is where it is, it is basically evil. One of the design points of C is "Trust programmers ". This is good, but there is confidence and then trust (there 'strust and then there's trust ). I mean, I trust my 5-year-old child, but I still won't let him walk alone through a bu
I recently learned ASP. NET MVC and compared the previous WebForm with no IsPostBack judgment, event processing is also replaced by Action. In the WebForm of MVC, a large number of events are bound to the UI, mixed js injection, and style changes are gone; the server control is no longer needed, and the View is released, the Controller can be tested in units, and the View can be quickly replaced with the ViewModel. (To be honest, it would not have been a page engine like Razor and powerful intel
Because the company uses SSH for projects, to understand how SSH is built and how it works, we have built one by ourselves.
Build a simple struts2 + spring + hibernate environment using the minimal jar package as much as possible. I hope that anyone like me can understand it. If you have used similar MVC patterns such as Microsoft MVC, it is much easier to understand.
First, I am using myeclipse 9 + Tomcat 6 (it is said that Tomcat and struts are incompatible, but I did not meet it, I do not kno
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.